<?php
defined('BASIC_ROUTES') or define('BASIC_ROUTES', ['list', 'create', 'update', 'info', 'delete']);
defined('ALL_ROUTES') or define('ALL_ROUTES', ['list', 'create', 'update', 'info', 'delete', 'status']);

return [
    'per_page' => 10,//每页长度
    'pwd' => 111111,//默认密码,
    'user_pwd' => 123456,
    'nav' => [
        [
            "id" => 1,
            "label" => "首页",
            "index" => "index",
            "icon" => "el-icon-home",
            "children" => []
        ],
        [
            "id" => 2,
            "label" => "用户管理",
            "index" => "user-sys",
            "icon" => "el-icon-user",
            "children" => [
                [
                    "id" => 201,
                    "label" => "用户列表",
                    "index" => "user",
                    "icon" => "",
                    "children" => []
                ],
                [
                    'id' => 202,
                    'label' => '角色列表',
                    'index' => 'user-role',
                    'icon' => ''
                ],
                [
                    'id' => 203,
                    'label' => '权限列表',
                    'index' => 'user-permission',
                    'icon' => ''
                ],
                [
                    'id' => 204,
                    'label' => '菜单管理',
                    'index' => 'user-menu',
                    'icon' => ''
                ]
            ]
        ]
    ],
    'routes' => [
        [
            //用户系统
            'prefix' => 'user-sys',
            'namespace' => 'User',
            'modules' => [
                [//用户权限
                    'controller' => 'PermissionController',
                    'name' => 'permission',
                    'route_type' => BASIC_ROUTES,
                    'extra' => [
                        [
                            'method' => 'get',
                            'uri' => 'tree',
                            'action' => 'tree'
                        ]
                    ]
                ],
                [//用户
                    'controller' => 'UserController',
                    'name' => 'user',
                    'route_type' => ALL_ROUTES,
                    'extra' => [
                        [
                            'method' => 'patch',
                            'uri' => '{user}/resetPassword',
                            'action' => 'resetPassword'
                        ],
                        [
                            'method' => 'post',
                            'uri' => '{user}/allot-permissions',
                            'action' => 'allotPermissions'
                        ],
                        [
                            'method' => 'post',
                            'uri' => '{user}/allot-roles',
                            'action' => 'allotRoles'
                        ]
                    ]
                ],
                [//角色权限
                    'controller' => 'RoleController',
                    'name' => 'role',
                    'route_type' => BASIC_ROUTES,
                    'extra' => [
                        [
                            'method' => 'post',
                            'uri' => '{role}/allot-permissions',
                            'action' => 'allotPermission'
                        ]
                    ]
                ],
                [//菜单权限
                    'controller' => 'MenuController',
                    'name' => 'menu',
                    'route_type' => BASIC_ROUTES,
                    'extra' => [
                        [
                            'method' => 'get',
                            'uri' => 'menu-select',
                            'action' => 'menuSelect'
                        ],
                        [
                            'method'=>'patch',
                            'uri'=>'{menu}/set-status',
                            'action'=>'menuSetStatus'
                        ],
                        [
                            //菜单组列表
                            'method'=>'get',
                            'uri'=>'menuGroup',
                            'action'=>'menuGroup'
                        ],
                        [
                            //添加菜单组
                            'method'=>'post',
                            'uri'=>'menuGroup',
                            'action'=>'createMenuGroup'
                        ],
                        [
                            //更新菜单组
                            'method'=>'post',
                            'uri'=>'menuGroup/{menuGroup}',
                            'action'=>'updateMenuGroup'
                        ],
                        [
                            //获取菜单组信息
                            'method'=>'get',
                            'uri'=>'menuGroup/{menuGroup}',
                            'action'=>'fetchMenuGroup'
                        ],
                        [
                            'method'=>'patch',
                            'uri'=>'menuGroup/{menuGroup}/setStatus',
                            'action'=>"menuGroupSetStatus"
                        ],
                        [
                            'method'=>'delete',
                            'uri'=>'menuGroup/{menuGroup}',
                            'action'=>'menuGroupDelete'
                        ]
                    ]
                ]
            ]
        ]
    ]
];
